import axios from 'axios'
import NProgress from 'nprogress'
import "nprogress/nprogress.css"
const request = axios.create({
    baseURL: '/item',
    timeout: 2000000
})
request.interceptors.request.use(config => {
    NProgress.start()
    return config
}, err => {
    NProgress.done()
    return Promise.reject(err)
})
request.interceptors.response.use(response => {
    NProgress.done()
    return response.data
}, err => {
    NProgress.done()
    console.error(err)
    return Promise.reject(err)
})
export default request